<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
  <script src="../js/vue.js"></script>
  <script src="../js/vuex.js"></script>
</head>

<body>
  <div id="app">

  </div>
  <script>
    // 1.状态机的声明
    let store = new Vuex.Store({
      // 数据模型（存放静态数据）
      state: {
        msg: 'vuex msg',
        tableData: []
      },
      // 计算属性
      getter: {
        reMsg(state) {
          return state.msg.toUpperCase()
        }
      },
      // 突变
      mutations: {
        SET_TABLEDATA(state, payload) {
          state.tableData = payload
        }
      },
      // 动作
      actions: {

      }
    })

    let vm = new Vue({
      el: "#app",
      data: {

      },
      methods: {

      },
      created() {

      },
      // 2.状态机的注册
      store
    })
  </script>
</body>

</html>